/*******************************************************************************************
This file is part of iToday.

iToday is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

iToday is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with iToday.  If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************************/
#pragma once

#define SZ_APP_NAME  L"iToday"
#define _ErrorLabel Error

#define CHR(hResult) \
    if(FAILED(hResult)) { hr = (hResult); goto _ErrorLabel;}

#define ERR_ON_FAIL(hResult) \
	if( FAILED( hResult ) ) \
	{ \
	goto _ErrorLabel;\
	}

#define CPR(pPointer) \
    if(NULL == (pPointer)) { hr = (E_OUTOFMEMORY); goto _ErrorLabel;}


#define CBR(fBool) \
    if(!(fBool)) { hr = (E_FAIL); goto _ErrorLabel;}

#define RELEASE_OBJ(s)  \
    if (s != NULL)      \
    {                   \
        s->Release();   \
        s = NULL;       \
    }

#define DELETE_OBJ(a) if(a !=NULL)\
{\
	DeleteObject(a);\
	a=NULL;\
}\
 
#define RES_PATH  TEXT("\\Windows\\")TEXT
#define SIZEBUFFER(x) sizeof(x)/sizeof (x)[0]


#define EMPTYRECT(X) \
	X.left	= 0;\
	X.right = 0;\
	X.top	= 0;\
	X.bottom= 0

#define EVALUATERECT(X,Y)\
	X.left	= Y.left;\
	X.right = Y.right;\
	X.top	= Y.top;\
	X.bottom= Y.bottom

#define EMPTYPOINT(X) \
	X.x		=0 ;\
	X.y		=0 ;
